<script setup lang="ts">
// 导入vant中的按钮组件
import { Button } from 'vant'

import { useUserStore } from './stores'

// 获取用户 Store
const userStore = useUserStore()

// 模拟登录逻辑
const login = () => {
  userStore.setUser({username: 'admin',token: '123456789'})
}

// 退出登录逻辑
const logout = () => {
  userStore.delUser()
}

</script>

<template>

  <Button type="primary" @click="login">登录</Button>
  <Button type="warning" @click="logout">退出</Button>
  

  <pre>




    
  </pre>


  <!-- 使用导入进来的按钮 -->
  <Button type="primary">按钮</Button>
  <!-- 使用vant的警告按钮 -->
  <Button type="warning">警告按钮</Button>
  
  
</template>

<style scoped>

</style>
